using System;
using System.Web.UI.WebControls;
using Oplaco.Web.DTO;
using System.Web;


public partial class FeaturedAd_ascx : System.Web.UI.UserControl
{

    protected void Page_Load(object sender, EventArgs e) {

        
            try
            {
                FeaturedAdversitmentManager manager = new FeaturedAdversitmentManager();
                CachedFeaturedAdvertismentCollection alist = manager.Fetch(HttpContext.Current, 3);

                if (alist != null && alist.Count > 0)
                {
                    FeaturedAdRepeater.DataSource = alist;
                    FeaturedAdRepeater.DataBind();
                }
            }
            catch (Exception exception) {

                Oplaco.Exceptions.AppService.ProcessAndNotifyPresentationLayerException(exception);
                
            }
            
        
    }


    protected void FeaturedAdDataSource_Selected(object sender, ObjectDataSourceStatusEventArgs e)
    {
        this.Visible = (e.ReturnValue != null);
    }

}
